28f7d1
@@ -75,7 +75,7 @@
public double estimateRowCount(RelMetadataQuery mq) {
 
   public boolean isBucketedInput() {
     final RelMetadataQuery mq = this.getInput().getCluster().getMetadataQuery();
-    return mq.distribution(this.getInput()).getKeys().
+    return mq.distribution(this).getKeys().
             containsAll(groupSet.asList());
   }
 
